<template>
	<!-- <view class="" v-if="time<time2"></view> -->
	<view class="login" :style="{paddingTop: height + 'px'}">
		<view class="flex-c login_title">
		</view>
		<view class="img">
			<image src="/static/logo.jpg" mode="widthFix"></image>
		</view>
		<button class="button flex-c" type=" " @click="login">微信授权登陆</button>
		<button class="button button2 flex-c" @click="handleback">取消</button>
		<!-- <view class="modal_view" v-if="isphone">
			<view class="fooot bg-white">
				<view class="A">获取授权</view>
				<view class="B">获取手机号的微信授权</view>
				<button class="flex-c" open-type="getPhoneNumber" @getphonenumber="phone">获取微信手机号</button>
			</view>
		</view> -->
	</view>
</template>

<script>
	// import {
	// 	mutations as uniIdMutations
	// } from '@/uni_modules/uni-id-pages/common/store.js';
	// import uniImUtils from '@/uni_modules/uni-im/common/utils.js';
	export default {
		data() {
			return {
				isclose: 0,
				height: 0,
				openid: '',
				isshow: 0,
				isphone: 0,
				user: '',
				id: null,
				mch_id: null,
				time: '',
				time2: '',
				href: ''
			}
		},
		onLoad(e) {
			// console.log(e.url,'urls');
			// this.href = e.url ? encodeURIComponent(e.url) : ""
		},
		created() {},
		methods: {
			login() {
				let appid = 'wx2451c4811732a3e4'
				let local = encodeURIComponent('https://aiyouzixun.top/#/pages/mine/index') // 获取页面url
				window.location.href =
					`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${ local}&response_type=code&scope=snsapi_userinfo&state=#wechat_redirect'`
			},
			handleback() {
				uni.navigateBack()
			},
		},
		onShow() {},


	}
</script>

<style lang="scss">
	.login {
		background-color: #fff;
		min-height: 100vh;
		min-width: 100vw;

		.login_title {
			text-align: center;
			height: 89rpx;
			font-size: 36rpx;
			color: #333;
			font-weight: bold;
			position: relative;

			.cuIcon-close {
				position: absolute;
				top: 20rpx;
				left: 20rpx;
				color: #999;
			}
		}
	}

	.img {
		width: 180rpx;
		height: 180rpx;
		margin: auto;
		margin-top: 109rpx;

		>image {
			width: 100%;
			height: 100%;
		}
	}

	.button {
		width: 622rpx;
		height: 98rpx;
		background: #1CD699;
		border-radius: 49rpx;
		font-size: 30rpx;
		color: #fff;
		margin-top: 171rpx;
	}

	.button2 {
		background: #E5E5E5;
		margin-top: 60rpx;
	}

	.text {
		padding-left: 66rpx;
		padding-right: 53rpx;
		position: absolute;
		bottom: 99rpx;

		image {
			width: 40rpx;
			height: 40rpx;
			margin-right: 13rpx;
		}
	}

	.fooot {
		position: fixed;
		bottom: 0;
		left: 0;
		height: 420rpx;
		width: 100%;
		border-radius: 20rpx 20rpx 0 0;
		text-align: center;
		padding: 50rpx 0;

		.A {
			font-size: 40rpx;
			color: #333;
		}

		.B {
			margin-top: 35rpx;
			margin-bottom: 80rpx;
		}

		button {
			width: 622rpx;
			height: 88rpx;
			background: #1CD699;
			border-radius: 44rpx;
			font-size: 35rpx;
			color: #fff;

		}
	}
</style>